/**
 * 路由组件
 */

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { HeroDetailComponent } from './app.herodetail.component';
import { HerosComponent } from './heroes.component';
import { DashboardComponent } from './dashboard.component';


const routes: Routes = [
    {
        path: "heroes",
        component: HerosComponent
    }, {
        path: 'dashboard',
        component: DashboardComponent
    }, {
        path: '',
        redirectTo: "/dashboard",
        pathMatch: 'full'
    }, {
        path: 'detail/:id',
        component: HeroDetailComponent
    }
]

@NgModule({
    imports: [RouterModule.forRoot(routes)],
    exports: [RouterModule]
})
export class AppRoutingModule { }




